<html>
<head>
    <title>添加</title>
    <meta charset="UTF-8">
</head>
<link rel="stylesheet" href="/static/layui/css/layui.css" />
<body>
<form class="layui-form" lay-filter="detail"   action="" >
<!--    <div class="layui-input-inline">-->
<!--        <input type="hidden" name="u_id" id="u_id" lay-verify="required" autocomplete="off" class="layui-input">-->
<!--    </div>-->
    <div class="layui-form-item">
        <label class="layui-form-label">ID：</label>
        <div class="layui-input-inline">
            <input type="text" name="uid" id="uid"  required  lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">身份：</label>
        <div class="layui-input-block">
            <select name="rid" id="rid" lay-verify="required">
                <option value="1">超级管理员</option>
                <option value="2">管理员</option>
                <option value="3">后勤人员</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">账号：</label>
        <div class="layui-input-inline">
            <input type="text" name="uusername" id="uusername"  required  lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码：</label>
        <div class="layui-input-inline ">
            <input type="text" name="upassword" id="upassword"  required  lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓名：</label>
        <div class="layui-input-inline">
            <input type="text" name="uname" id="uname"  required  lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">年龄：</label>
        <div class="layui-input-inline">
            <input type="text" name="uage" id="uage"  required  lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">电话：</label>
        <div class="layui-input-inline ">
            <input type="tel" name="utel" id="utel" lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态：</label>
        <div class="layui-input-inline">
            <input type="tel" name="ustatus" id="ustatus" lay-verify="required" placeholder="..." autocomplete="off" class="layui-input">
        </div>
    </div>
</form>
</body>

<script src="/static/js/system.js"></script>
<script src="/static/js/jquery-3.3.1.js"></script>
<script src="/static/layui/layui.js"></script>
<script>
    $(function () {
        $("input").prop("disabled","disabled");
        $("select").prop("disabled","disabled");
    })
    layui.use(['form','layer'], function(){
        var form = layui.form;
        $.ajax({
            url:'/UserServlet?method=queryOne',
            type:"post",
            dataType:"json",
            data:{"id":getQueryString("id")},
            success:function (da) {
                if (da.code == 0) {
                    // form.val("detail", da.data);
                    $.each(da.data,function (index,i) {
                        $('#uid').val(i.uid);
                        $("#rid").find("option[value="+i.rid+"]").prop("selected",true);
                        $('#uusername').val(i.uusername);
                        $('#upassword').val(i.upassword);
                        $("#uname").val(i.uname);
                        $('#uage').val(i.uage);
                        $('#utel').val(i.utel);
                        $("#ustatus").val(i.ustatus);
                    });
                    form.render('select');
                } else {
                    parent.layer.msg("详情查询失败！");
                }
            }
        });
    });
</script>
</html>